#ifndef __DRIVER_
#define __DRIVER_

#include "main.h"
#include "lv_port.h"
#include "date_time.h"
#include "cmsis_os2.h"
#include "mpu6050/mpu6050.h"

typedef struct
{
    float ouler[3]; /*度*/
    float acc[3];   /*m/s*/
    float gryo[3];  /*度/s*/
}imu_t;

typedef struct
{
    int32_t pressure;
    float altitude;
} pressure_t;

void hw_init(void);

void hw_task_init(void);

/*获取IMU信息*/
bool get_imu_val(imu_t *val);

/*获取pressure信息*/
bool get_pressure_val(pressure_t *val);
/*获取温度信息*/
float get_temperature_val(void);

/*获取步数*/
uint32_t get_pedometer_val(void);
/*设置步数*/
static inline void set_pedometer_val(uint32_t val) {mpu_set_pedometer_step_count(val);}

/*获取电池电压*/
static inline float get_battery_voltage(void) {return battery_voltage();}

/*设置显示屏亮度*/
static inline void set_lcd_bright(uint16_t light) {st7789_set_blk(light);}

/*设置按键回调函数*/
static inline void set_button_cbfun(button_event_cb_t cb) {button_set_event_cb(cb);}

/*设置点击事件回调函数*/
static inline void set_tab_cbfun(void (*func)(unsigned char, unsigned char)) {mpu6050_reg_tab_cb(func);}

#endif /*__DRIVER_*/